home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-09 | 3.1 KB | 72 lines | [TEXT/KEEN] |
- # $MA7_RunClip : takes the actual hAWK program to be run from the system
- # clipboard, and runs it on the list of files specified in "$tempStdOut".
- # Intended mainly for use with Minimal App7.
- #
- # NOTE this program does NOT allow you to set variables, so it should only
- # be used to run hAWK programs that do not require preset variables—or
- # programs which will run to your satisfaction with all preset variables set
- # to zero or the null string. For example, "$CompareFiles" has a couple of
- # preset variables, but will normally work fine without setting them.
- #
- # To run this program using Minimal App7:
- # 1 Using your favorite editor, create a list of full path names
- # for your desired input files, and put the list in "$tempStdOut".
- # This can easily be done by running "$EchoFullPathNames".
- # 2 Again using your favorite editor, Open and Copy the entire hAWK
- # program you wish to run.
- # 3 Switch to Minimal App7, call up hAWK, and select this program
- # (ie "$MA7_RunClip").
- # 4 If this is your FIRST RUN of "$MA7_RunClip", use the "Take input
- # from" popup to select "$tempStdOut" as the specific input
- # file. Then click the "Save settings" button. This needs to be
- # done the first time only.
- # 5 Click the Run button, and then switch out to another application
- # if you wish. Minimal App7 will notify you when it is done.
- # 6 Results of the run will be in the usual place (typically "$tempStdOut").
- #
- # Note technically you could use some other file besides "$tempStdOut" to
- # hold the list of files, but since "$EchoFullPathNames" sends the list
- # there, this is the easiest way. If you have a fixed list of files, you
- # could use a dedicated file for this list - just put the list in the
- # dedicated file before running this program, and change the specific input
- # file this program uses to the dedicated file.
-
- # User’s Manual references:
- # «hAWK User’s Manual» «F Running hAWK programs»
- # «hAWK User’s Manual» «L 5 Regular expressions»
- # «hAWK User’s Manual» «M 5 Built-in string and file functions»
- # «hAWK User’s Manual» «K 4 Built-in variables»
- # «hAWK User’s Manual» «K 8 Arrays»
- # «hAWK User’s Manual» «N User-defined functions»
- # «hAWK User’s Manual» «P 3 The getline function»
- # «hAWK User’s Manual» «O 3 Output into files»
- # «hAWK User’s Manual» «Q The hAWK function»
-
-
- #This is the modification to be added to the beginning of any program
- #that wants a list of files in specific order to use as input:
- BEGIN {while (getline _specific_file_ < ARGV[1] > 0)
- {
- if (length(_specific_file_) > 1 &&
- index(_specific_file_, ":") > 0)
- ARGV[ARGC++] = _specific_file_;
- }
- close(ARGV[1]);
- ARGV[1] = "";
- }
- #end modification
-
- # Print the clip to a temporary file, and run it as a hAWK program
- # on the list of files provided in the file ARGV[1].
- BEGIN {
- progFile = STDPATH "Drag_on Modules:hAWK programs:$hAWKTempProgram"
- print getclip() > progFile
- close(progFile)
- argv[x++] = "hAWK"
- argv[x++] = "-f" progFile
- argv[x++] = "--"
- for (j = 2; j < ARGC; ++j) # Note ARGV[1] was nulled out above.
- argv[x++] = ARGV[j]
- hAWK(argv)
- }
-